<div ng-controller="saleStatisticsCtrl">
    <ol class="breadcrumb">
        <li><a href="javascript:void(0)">报表管理</a></li>
        <li>销售月统计</li>
    </ol>
    <div class="content-container">
        <div class="query">
            <div class="row">
                <form>
                    <div class="col-lg-2" select-search my-list="stores" select-value="conditions.select_store" key="name" placeholder="请选择店面名称">
                    </div>
                    <div class="col-lg-1">
                        <div class="input-group input-group-sm">
                            <input type="text" class="form-control" uib-datepicker-popup="yyyy-MM-dd" ng-model="conditions.start_date" is-open="date_s" close-text="关闭" clear-text="清除" current-text="今天" placeholder="开始时间" ng-focus="date_s=true" />
                        </div>
                    </div>
                    <div class="col-lg-1 u-date">
                        -
                    </div>
                    <div class="col-lg-1">
                        <div class="input-group input-group-sm">
                            <input type="text" class="form-control" uib-datepicker-popup="yyyy-MM-dd" ng-model="conditions.end_date" is-open="date_e" close-text="关闭" clear-text="清除" current-text="今天" placeholder="结束时间" ng-focus="date_e=true" />
                        </div>
                    </div>
                    <div class="col-lg-1">
                        <div class="input-group input-group-sm">
                            <select class="form-control" ng-model="conditions.type" ng-change="query()">
                                <option value="0">放款</option>
                                <option value="1">进件</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-1">
                        <div class="input-group input-group-sm text-right">
                            <button class="btn btn-primary query-btn" ng-click="query()">查询</button>
                        </div>
                    </div>
                    <div class="col-lg-1">
                        <div class="input-group input-group-sm text-right">
                            <button class="btn btn-default query-btn" ng-click="clearQuery()">清除</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div chart-pie data="chartData" style="width: 80%;height:300px;margin: 0 auto;" ng-show="data.length > 0"></div>
        <div class="datagrid">
            <table class="table table-bordered" ng-show="data.length > 0">
                <tr>
                    <th style="width:5%;">序号</th>
                    <th style="width:15%;">销售人员</th>
                    <th style="width:20%;">联系电话</th>
                    <th style="width:15%;">笔数</th>
                    <th style="width:15%;">占比</th>
                    <th style="width:30%;">金额</th>
                </tr>
                <tr ng-repeat="key in data" ng-click="selectRow(key)" ng-class="{'bg-info' : key.selected}">
                    <td>{{$index+1+(conditions.page-1)*conditions.rows}}</td>
                    <td>{{key.sellName}}</td>
                    <td>{{key.sellPhone}}</td>
                    <td>{{key.count}}</td>
                    <td>{{key.ratio |addPercentage}}</td>
                    <td>{{key.money}}</td>
                </tr>
            </table>
            <div ng-show="data.length == 0" class="alert alert-warning">
                <span class="glyphicon glyphicon-info-sign"></span>&nbsp;查无相关数据，请重新查询！
            </div>
        </div>
    </div>
    <div alert title="alert.title" content="alert.content" open="alert.open"></div>
</div>
<!-- end controller -->